﻿@model Apps.Models.Spl.Spl_ProductModel
@using Apps.Web.Core;
@using Apps.Common;
@using Apps.Models.Spl;
@using Apps.Web;
@using Apps.Locale;
@using Apps.Models.Sys;
@{
    ViewBag.Title = "修改";
    Layout = "~/Views/Shared/_Index_LayoutEdit.cshtml";
    List<permModel> perm = null;
}

<script type="text/javascript">
    $(function () {
        $("#btnSave").click(function () {
            if ($("form").valid()) {
                $.ajax({
                    url: "@Url.Action("Edit")",
                    type: "Post",
                    data: $("form").serialize(),
                    dataType: "json",
                    success: function (data) {
                        if (data.type == 1) {
                            window.parent.frameReturnByMes(data.message);
                            window.parent.frameReturnByReload(true);
                            window.parent.frameReturnByClose()
                        }
                        else {
                            window.parent.frameReturnByMes(data.message);
                        }
                    }
                });
            }
            return false;
        });
        $("#btnReturn").click(function () {
            window.parent.frameReturnByClose();
        });
    });
</script>
<div class="mvctool bgb">
    @Html.ToolButton("btnSave", "fa fa-save", Resource.Save,ref perm, "Save", true)
    @Html.ToolButton("btnReturn", "fa fa-reply", Resource.Reply, false)
</div>
@using (Html.BeginForm())
{
    @Html.HiddenFor(model => model.Id)
    @Html.HiddenFor(model => model.CreateTime)
    <table class="formtable">
        <tbody>
            <tr>
                <th>
                    @Html.LabelFor(model => model.Name)：
                </th>
                <td>
                    @Html.EditorFor(model => model.Name)
                </td>
                <td>@Html.ValidationMessageFor(model => model.Name)</td>
            </tr>
            <tr>
                <th>
                    @Html.LabelFor(model => model.Code)：
                </th>
                <td>
                    @Html.EditorFor(model => model.Code)
                </td>
                <td>@Html.ValidationMessageFor(model => model.Code)</td>
            </tr>
            <tr>
                <th>
                    @Html.LabelFor(model => model.Price)：
                </th>
                <td>
                    @Html.EditorFor(model => model.Price)
                </td>
                <td>@Html.ValidationMessageFor(model => model.Price)</td>
            </tr>
            <tr>
                <th>
                    @Html.LabelFor(model => model.Color)：
                </th>
                <td>
                    @Html.EditorFor(model => model.Color)
                </td>
                <td>@Html.ValidationMessageFor(model => model.Color)</td>
            </tr>
            <tr>
                <th>
                    @Html.LabelFor(model => model.Number)：
                </th>
                <td>
                    @Html.EditorFor(model => model.Number)
                </td>
                <td>@Html.ValidationMessageFor(model => model.Number)</td>
            </tr>
            <tr>
                <th>
                    @Html.LabelFor(model => model.CategoryId)：
                </th>
                <td>
                    @Html.EditorFor(model => model.CategoryId)
                </td>
                <td>@Html.ValidationMessageFor(model => model.CategoryId)</td>
            </tr>
            <tr>
                <th>
                    @Html.LabelFor(model => model.CreateTime)：
                </th>
                <td>
                    @Html.EditorFor(model => model.CreateTime)
                </td>
                <td>@Html.ValidationMessageFor(model => model.CreateTime)</td>
            </tr>
            <tr>
                <th>
                    @Html.LabelFor(model => model.CreateBy)：
                </th>
                <td>
                    @Html.EditorFor(model => model.CreateBy)
                </td>
                <td>@Html.ValidationMessageFor(model => model.CreateBy)</td>
            </tr>
        </tbody>
    </table>
}
